package com.niiwoo.civet.account.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 账单关联查询条件类型
 * Created by xiaoyingping on 2018/1/2.
 */
@AllArgsConstructor
@Getter
public enum BillDateReleatedTypeEnum {
    ID((byte) 0, "ID"),
    ORDER_ID((byte) 1, "订单ID"),
    PROJECT_ID((byte) 2, "项目ID");

    private byte value;
    private String desc;

    public static BillDateReleatedTypeEnum getEnumByCode(byte enumCode) {
        if (Objects.nonNull(enumCode)) {
            for (BillDateReleatedTypeEnum retEnum : BillDateReleatedTypeEnum.values()) {
                if (enumCode == retEnum.getValue()) {
                    return retEnum;
                }
            }
        }
        return null;
    }
}
